 
import  request  from "@/utils/request";
// 获取所有课程分类列表
export const queryAllCourseCategory = (categoryName,page, pageSize) => {
    return request.get('/courseSort',{
        params: {
            categoryName:categoryName, 
            page: page, 
            pageSize: pageSize 
        } 
    }).then((result) => result.data)
}

export const queryCourseCategoryById = (id) => {
    return request.get(`/courseSort/${id}`).then((result) => result.data) 
}

export const deleteCourseCategory= (ids) => {
    return request.delete('/courseSort',{
        params: { ids: ids }
    }).then((result) => result.data) 
}

export const addCourseCategory = (data) => {
    return request.post('/courseSort', data
    ).then((result) => result.data) 
}

export const updateCourseCategory = (data) => {
    return request.put('/courseSort', data   
    ).then((result) => result.data) 
}